<extend name="Public/base"/>
<block name="content">
<h3 class="col-md-8">艺术家管理</h3>
<div class="col-md-4">
	<div class="input-group mb-lg search-form">
    	<input type="text" class="form-control search-input" name="title" value="" placeholder="请输入艺术家名称">
    	<a class="input-group-addon btn" id="search" url="<{:U('Artist/index',false,false)}>">
        	<i class="fa-search fa" ></i>
    	</a>
	</div>
</div>
<div class="row">
    <div class="col-lg-12">
    	<div class="panel panel-default">
       		<div class="panel-heading ">艺术家列表
       			<div class="btn-group pull-right">
	       			<a class="btn btn-labeled btn-success" href="<{:U('add')}>">新增</a>
	       			<a class="btn btn-labeled btn-success ajax-post "  href="<{:U('setStatus',array('status'=>1))}>" target-form="ids">启用</a>
	       			<a class="btn btn-labeled btn-danger ajax-post "  href="<{:U('setStatus',array('status'=>0))}>" target-form="ids">禁用</a>                
	                <a class="btn btn-labeled btn-danger ajax-post" href="<{:U('del')}>" target-form="ids">删除</a>
	         	</div>      			
       		</div>
    		<div class="table-responsive home_content">
        		<table class="table table-striped table-bordered table-hover">           
            		<thead>
                		<tr>
                			<th style="width: 5%" class="check-all">
                          		<div data-toggle="tooltip" data-title="全选" class="checkbox c-checkbox">
                             		<label>
                                		<input type="checkbox">
                                		<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</th> 
                        	<th>ID</th>
        					<th>艺术家名称</th>
        					<th>所属类型</th>
        					<th>所属地区</th>
        					<th>索引</th>
        					<th>点击数</th>
        					<th>荐</th>
        					<th>评分</th>
        					<th style="width: 5%">状态</th>
                     		<th>添加时间</th>
                     		<th class="text-center">操作</th>
                      	</tr>
                    </thead>
                    <tbody>
                    	<notempty name="list">
                    	<volist name="list" id="data" key="k">
                      	<tr>
                        	<td>
                          		<div class="checkbox c-checkbox">
                             		<label>
                                	<input type="checkbox" class="ids" value="<{$data.id}>" name="ids[]">
                                	<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</td>
                        	<td><{$data.id}></td>
        					<td class='m-name'><a class="edit-name" href="#"><{$data.name}></a></td>
        					<td><{$data.type_name}></td>
        					<td><{$data.region}></td>
        					<td><{$data.sort}></td>
        					<td><{$data.hits}></td>
        					<if condition="$data.recommend eq 0">
        					<td>否</td>
        					<else/>
        					<td style="color:#63930A">是</td>
        					</if>
        					<td><{$data.rater}></td>
        					<td><{$data.status|get_status_title}></td>
                        	<td><{$data.add_time|time_format='Y-m-d'}></td>
                    		<td class="text-center">
	                            <a class="btn btn-labeled btn-sm" href="<{:U('mod?id='.$data['id'])}>"><em class="fa fa-edit"></em></a>
	                            <a class="btn btn-labeled btn-sm btn-danger btn-del" url="<{:U('del?ids='.$data['id'])}>"><em class="fa fa-times"></em></a>
                         	</td>
                      	</tr>
                      	</volist>
        				<else/>
        				<td colspan="11" class="text-center">暂时还没有内容! </td>
        				</notempty>
                    </tbody>
                </table>
    		</div>
    		<!-- 结束 表格 -->
    		<div class="panel-footer">
    			<div class="row">
					<ul class="pagination">
					<{$_page}>
					</ul>
				 </div>
            </div>    		
    	</div>
	</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
	//导航高亮
	highlight_subnav("<{:U('Songs/index')}>","<{:U('Artist/index')}>")
    //搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
		var status = $("#sch-sort-txt").attr("data");
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
		if(status != ''){
			query += 'status=' + status + "&" + query;
        }
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
</script>
</block>	


